def func1():
    n = int(input())#每次读取固定的长度n

    array = []#储存输入的数组
    while True:
        try:
            line = input().strip()#读取第一行并去掉首尾空格
            if not line:
                continue#遇到空行跳过
            arr = line.split(',')#用逗号分割成列表
            arr = [int(x) for x in arr if x]#转换成整数，并过滤空字符串
            array.append(arr)
        except EOFError:
            break

    ret = []
    while any(array):#只要数组不为空就继续循环
        for arr in array[:]:#遍历array的副本（避免修改影响迭代）
            if not arr:#如果数组为空就跳过
                continue
            take = min(n,len(arr))#如果不为空，就取出前n个或者剩余所有元素
            ret.extend(arr[:take])
            del arr[:take]#删除已经取出的元素

    print(','.join(map(str,ret)))

func1()


import sys

def is_sushu(num):#检测是否是素数
    if num<2:
        return False
    for k in range(2,int(num**0.5)+1):
        if num % k == 0:
            return False
    return True

def creat_sushu(n):#创建n个素数
    sushu = []
    num = 2#从最小的素数开始创建
    while len(sushu) < n:
        if is_sushu(num):
            sushu.append(num)
        num += 1
    return sushu

def is_exit_arr(sushu,M):#检测是否存在子数组之和为M
    left = 0
    sum = 0
    for right in range(len(sushu)):
        sum += sushu[right]
        while sum > M and left <= right:
            sum -= sushu[left]
            left += 1
        if sum == M:
            return True
    return False

def main():
    input = sys.stdin.read().split()
    n = int(input[0])
    list1 = list(map(int,input[1:n+1]))

    students = creat_sushu(1000)

    for M in list1:
        if is_exit_arr(students,M):
            print("yes")
        else:
            print("no")

if __name__ == "__main__":
    main()


























